package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CourseCommentsMapper;
import com.ruoyi.system.domain.CourseComments;
import com.ruoyi.system.service.ICourseCommentsService;

/**
 * 课堂评论Service业务层处理
 * 
 * @author zrj
 * @date 2025-07-15
 */
@Service
public class CourseCommentsServiceImpl implements ICourseCommentsService 
{
    @Autowired
    private CourseCommentsMapper courseCommentsMapper;

    /**
     * 查询课堂评论
     * 
     * @param commentUid 课堂评论主键
     * @return 课堂评论
     */
    @Override
    public CourseComments selectCourseCommentsByCommentUid(Long commentUid)
    {
        return courseCommentsMapper.selectCourseCommentsByCommentUid(commentUid);
    }

    /**
     * 查询课堂评论列表
     * 
     * @param courseComments 课堂评论
     * @return 课堂评论
     */
    @Override
    public List<CourseComments> selectCourseCommentsList(CourseComments courseComments)
    {
        return courseCommentsMapper.selectCourseCommentsList(courseComments);
    }

    /**
     * 新增课堂评论
     * 
     * @param courseComments 课堂评论
     * @return 结果
     */
    @Override
    public int insertCourseComments(CourseComments courseComments)
    {
        courseComments.setCreateTime(DateUtils.getNowDate());
        return courseCommentsMapper.insertCourseComments(courseComments);
    }

    /**
     * 修改课堂评论
     * 
     * @param courseComments 课堂评论
     * @return 结果
     */
    @Override
    public int updateCourseComments(CourseComments courseComments)
    {
        courseComments.setUpdateTime(DateUtils.getNowDate());
        return courseCommentsMapper.updateCourseComments(courseComments);
    }

    /**
     * 批量删除课堂评论
     * 
     * @param commentUids 需要删除的课堂评论主键
     * @return 结果
     */
    @Override
    public int deleteCourseCommentsByCommentUids(Long[] commentUids)
    {
        return courseCommentsMapper.deleteCourseCommentsByCommentUids(commentUids);
    }

    /**
     * 删除课堂评论信息
     * 
     * @param commentUid 课堂评论主键
     * @return 结果
     */
    @Override
    public int deleteCourseCommentsByCommentUid(Long commentUid)
    {
        return courseCommentsMapper.deleteCourseCommentsByCommentUid(commentUid);
    }
}
